package service;

import dao.BookDao;
import dao.BookDaoImpl;
import entry.Books;

import javax.servlet.annotation.WebServlet;
import java.util.ArrayList;

public class BookServiceImpl implements BookService{
    BookDao bookDao=new BookDaoImpl();
    @Override
    public boolean addBook(Books book) {

        return bookDao.insertBook(book)!=0?true:false;
    }

    @Override
    public ArrayList<Books> selectMatch(Books book) {
        return bookDao.selectMatch(book);
    }

    @Override
    public ArrayList<Books> selectAll() {
        System.out.println("aaaaaaa");
        return bookDao.selectAll();
    }

    @Override
    public boolean deleteBook(int bid) {
        return bookDao.deleteBook(bid);
    }

    @Override
    public Books selectById(int bid) {

        return bookDao.selectById(bid);

    }

    @Override
    public boolean updateBook(Books book) {
        return bookDao.updateBook(book);
    }
}
